#include <iostream>
#include <math.h>
using namespace std;
int main ()
{


    int n1, aux;
    int suma=0;

    cin>>n1;
    aux=n1-1;


    while(n1>aux)

    {
        suma=suma+n1;

        aux=n1;

        cin>>n1;
    }

    cout<<suma;



    return 1;



}
